import type {App} from 'vue'
import { useUserInfoStore } from '@/stores/userInfo'

export default function registerPermissionDirective(app:App){
    const userInfoStore = useUserInfoStore()
    app.directive('permission',(el,binding)=>{
        const isDisplay = userInfoStore.buttons.includes(binding.value)
        if(!isDisplay){
            el.style.display = 'none'
        }
    })
}